<?php
/**
 * Created by PhpStorm.
 * User: zl
 * Date: 2017/5/9
 * Time: 22:55
 */
    require_once('../Common.php');
    require_once('../SQLBase.php');

    $db = new SQLBase();

    $query = 'SELECT * FROM  allsection';

    $result = $db->queryData($query);

    $resultArray = array();

    for($i = 0; $i < $result->num_rows; $i++){
        $data = $result->fetch_array();
        $resultArray[$i] = array('section_id'=>$data['section_ID'], 'section_name'=>$data['section_name']);
    }

    echo json_encode($resultArray);



?>